<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>animation</title>
<meta name="description" content="CSS3 animation属性用于检索或设置对象所应用的动画特效" />
<meta name="keywords" content="animation, css3, css3参考手册" />
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<meta name="robots" content="all" />
<!--[if lte IE 8]>
<script src="../../js/html5.js"></script>
<![endif]-->
<link rel="stylesheet" href="../../skin/article.css" />
</head>
<body>
<nav id="guide" class="g-mod">
	<div class="from">
		<a href="http://css.doyoe.com/" target="_blank">CSS3参考手册</a>
		<span>&#187;</span>
		<a href="../index.htm">属性列表</a>
		<span>&#187;</span>
		<a href="index.htm" id="category" rel="properties/animation" name="animation">动画属性</a>
		<span>&#187;</span>
	</div>
	<div class="to">
		<span class="label">相关内容：</span>
		<div class="g-combobox g-transition">
			<a href="?" class="g-transition target">
				<strong>其它动画属性参考</strong>
				<span>选择其它项<!--[if lte IE 7]><ins>IE7 and earlier, Get to die</ins><![endif]--></span>
			</a>
			<div class="g-transition list">
				<ul>
					<!-- 插入快速分类导航 -->
				</ul>
			</div>
		</div>
	</div>
</nav>
<header id="hd">
	<section id="title" class="g-mod">
		<h1 class="tit">animation</h1>
		<ul class="info">
			<li><strong>版本：CSS3</strong></li>
			<li>2015.8.13</li>
		</ul>
		<!-- 插入浏览器信息 -->
	</section>
</header>
<section id="bd">
	<section id="syntax" class="g-mod g-attr">
		<h2 class="tit">语法：</h2>
		<div class="cont">
			<p><strong>animation</strong>：<a href="#single-animation">&lt;single-animation&gt;</a>[,<a href="#single-animation">&lt;single-animation&gt;</a>]*</p>
			<p id="single-animation"><strong>&lt;single-animation&gt;</strong> = <a href="animation-name.htm#single-animation-name">&lt;single-animation-name&gt;</a> || <a href="../../values/time/time.htm">&lt;time&gt;</a> || <a href="animation-timing-function.htm#single-animation-timing-function">&lt;single-animation-timing-function&gt;</a> || <a href="../../values/time/time.htm">&lt;time&gt;</a> || <a href="animation-iteration-count.htm#single-animation-iteration-count">&lt;single-animation-iteration-count&gt;</a> || <a href="animation-direction.htm#single-animation-direction">&lt;single-animation-direction&gt;</a> || <a href="animation-fill-mode.htm#single-animation-fill-mode">&lt;single-animation-fill-mode&gt;</a> || <a href="animation-play-state.htm#single-animation-play-state">&lt;single-animation-play-state&gt;</a></p>
			<p><strong>默认值</strong>：<mark class="defaultvalue">看每个独立属性</mark></p>
			<p><strong>适用于</strong>：所有元素，包含伪对象:after和:before</p>
			<p><strong>继承性</strong>：无</p>
			<p><strong>动画性</strong>：否</p>
			<p><strong>计算值</strong>：看每个独立属性</p>
			<p><strong>媒体</strong>：视觉</p>
		</div>
	</section>
	<section id="value" class="g-mod g-attr">
		<h2 class="tit">取值：</h2>
		<div class="cont">
			<dl>
				<dt>&lt;' <a href="animation-name.htm">animation-name</a> '&gt;：</dt>
				<dd>检索或设置对象所应用的动画名称</dd>
				<dt>&lt;' <a href="animation-duration.htm">animation-duration</a> '&gt;：</dt>
				<dd>检索或设置对象动画的持续时间</dd>
				<dt>&lt;' <a href="animation-timing-function.htm">animation-timing-function</a> '&gt;：</dt>
				<dd>检索或设置对象动画的过渡类型</dd>
				<dt>&lt;' <a href="animation-delay.htm">animation-delay</a> '&gt;：</dt>
				<dd>检索或设置对象动画延迟的时间</dd>
				<dt>&lt;' <a href="animation-iteration-count.htm">animation-iteration-count</a> '&gt;：</dt>
				<dd>检索或设置对象动画的循环次数</dd>
				<dt>&lt;' <a href="animation-direction.htm">animation-direction</a> '&gt;：</dt>
				<dd>检索或设置对象动画在循环中是否反向运动</dd>
				<dt>&lt;' <a href="animation-fill-mode.htm">animation-fill-mode</a> '&gt;：</dt>
				<dd>检索或设置对象动画时间之外的状态</dd>
				<dt>&lt;' <a href="animation-play-state.htm">animation-play-state</a> '&gt;：</dt>
				<dd>检索或设置对象动画的状态。<em class="glight">w3c正考虑是否将该属性移除，因为动画的状态可以通过其它的方式实现，比如重设样式</em></dd>
			</dl>
		</div>
	</section>
	<section id="intro" class="g-mod g-attr">
		<h2 class="tit">说明：</h2>
		<div class="cont">
			<strong>复合属性。检索或设置对象所应用的动画特效。</strong>
			<ul>
				<li>如果提供多组属性值，以逗号进行分隔。</li>
				<li>注意：如果只提供一个<a href="../../values/time/time.htm">&lt;time&gt;</a>参数，则为 &lt;' <a href="animation-duration.htm">animation-duration</a> '&gt; 的值定义；如果提供二个<a href="../../values/time/time.htm">&lt;time&gt;</a>参数，则第一个为 &lt;' <a href="animation-duration.htm">animation-duration</a> '&gt; 的值定义，第二个为 &lt;' <a href="animation-delay.htm">animation-delay</a> '&gt; 的值定义</li>
				<li>对应的脚本特性为<strong>animation</strong>。</li>
			</ul>
		</div>
	</section>
	<section id="compatible" class="g-mod g-attr">
		<h2 class="tit">兼容性：</h2>
		<div class="cont">
			<ul class="support-type">
				<li><span class="support">浅绿</span> = 支持</li>
				<li><span class="unsupport">红色</span> = 不支持</li>
				<li><span class="partsupport">粉色</span> = 部分支持</li>
			</ul>
			<table class="g-data">
                <thead>
                    <tr>
                        <th>Values</th>
                        <th>IE</th>
                        <th>Firefox</th>
                        <th>Chrome</th>
                        <th>Safari</th>
                        <th>Opera</th>
                        <th>iOS Safari</th>
                        <th>Android Browser</th>
                        <th>Android Chrome</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td rowspan="3"><strong>Basic Support</strong></td>
                        <td class="unsupport">6.0-9.0</td>
                        <td class="unsupport">2.0-4.0</td>
                        <td class="support">4.0-42.0<sup class="fix">-webkit-</sup></td>
                        <td class="support">6.0-8.0<sup class="fix">-webkit-</sup></td>
                        <td class="support">15.0-29.0<sup class="fix">-webkit-</sup></td>
                        <td class="support">6.0-8.4<sup class="fix">-webkit-</sup></td>
                        <td class="partsupport">2.1-3.0<sup class="fix">-webkit-</sup> <sup><a href="#support1">#1</a></sup></td>
                        <td class="support" rowspan="3">18.0-42.0<sup class="fix">-webkit-</sup></td>
                    </tr>
                    <tr>
                        <td class="support" rowspan="2">10.0+</td>
                        <td class="support">5.0-15.0<sup class="fix">-moz-</sup></td>
                        <td class="support" rowspan="2">43.0+</td>
                        <td class="support" rowspan="2">9.0+</td>
                        <td class="support" rowspan="2">30.0+</td>
                        <td class="support" rowspan="2">9.0+</td>
                        <td class="support" rowspan="2">4.0-40.0<sup class="fix">-webkit-</sup></td>
                    </tr>
                    <tr>
                        <td class="support">16.0+</td>
                    </tr>
                </tbody>
            </table>
            <ol class="support-info">
                <li id="support1">在一些场景中会有错误行为</li>
                <li id="support2">部分浏览器不支持伪元素动画，或者支持得不够好，尽可能不要利用伪元素来做动画</li>
            </ol>
		</div>
	</section>
	<section id="example" class="g-mod g-attr">
		<h2 class="tit">示例：</h2>
		<div class="cont">
			<textarea cols="90" rows="10">
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="utf-8" />
<title>animation_CSS参考手册_web前端开发参考手册系列</title>
<meta name="author" content="Joy Du(飘零雾雨), dooyoe@gmail.com, www.doyoe.com" />
<style>
div{position:absolute;top:50%;left:50%;overflow:hidden;width:300px;height:150px;margin:-75px 0 0 -150px;border:3px solid #eee;background:#e0e0e0;}
span{display:block;height:50px;font:bold 14px/50px Georgia;}
.a1{
    -webkit-transform:translate(60px);
    -moz-transform:translate(60px);
    transform:translate(60px);
    -webkit-animation:animations 2s ease-out forwards;
    -moz-animation:animations 2s ease-out forwards;
    animation:animations 2s ease-out forwards;
}
@-webkit-keyframes animations{
    0%{-webkit-transform:translate(0);opacity:0;}
    50%{-webkit-transform:translate(30px);opacity:1;}
    70%{-webkit-transform:translate(35px);opacity:1;}
    100%{-webkit-transform:translate(60px);opacity:0;}
}
@-moz-keyframes animations{
    0%{-moz-transform:translate(0);opacity:0;}
    50%{-moz-transform:translate(30px);opacity:1;}
    70%{-moz-transform:translate(35px);opacity:1;}
    100%{-moz-transform:translate(60px);opacity:0;}
}
@keyframes animations{
    0%{transform:translate(0);opacity:0;}
    50%{transform:translate(30px);opacity:1;}
    70%{transform:translate(35px);opacity:1;}
    100%{transform:translate(60px);opacity:0;}
}
.a3{
    opacity: 0;
    -webkit-transform:translate(100px);
    -moz-transform:translate(100px);
    transform:translate(100px);
    -webkit-animation:animations3 2s ease-out 2s forwards;
    -moz-animation:animations3 2s ease-out 2s forwards;
    animation:animations3 2s ease-out 2s forwards;
}
@-webkit-keyframes animations3{
    0%{-webkit-transform:translate(160px);opacity:0;}
    50%{-webkit-transform:translate(130px);opacity:1;}
    70%{-webkit-transform:translate(125px);opacity:1;}
    100%{-webkit-transform:translate(100px);opacity:0;}
}
@-moz-keyframes animations3{
    0%{-moz-transform:translate(160px);opacity:0;}
    50%{-moz-transform:translate(130px);opacity:1;}
    70%{-moz-transform:translate(125px);opacity:1;}
    100%{-moz-transform:translate(100px);opacity:0;}
}
@keyframes animations3{
    0%{transform:translate(160px);opacity:0;}
    50%{transform:translate(130px);opacity:1;}
    70%{transform:translate(125px);opacity:1;}
    100%{transform:translate(100px);opacity:0;}
}
.a2{
    opacity: 0;
    text-align:center;font-size:26px;
    -webkit-animation:animations2 5s ease-in-out 4s forwards;
    -moz-animation:animations2 5s ease-in-out 4s forwards;
    animation:animations2 5s ease-in-out 4s forwards;
}
@-webkit-keyframes animations2{
    0%{opacity:0;}
    40%{opacity:.8;}
    45%{opacity:.3;}
    50%{opacity:.8;}
    55%{opacity:.3;}
    60%{opacity:.8;}
    100%{opacity:0;}
}
@-moz-keyframes animations2{
    0%{opacity:0;}
    40%{opacity:.8;}
    45%{opacity:.3;}
    50%{opacity:.8;}
    55%{opacity:.3;}
    60%{opacity:.8;}
    100%{opacity:0;}
}
@keyframes animations2{
    0%{opacity:0;}
    40%{opacity:.8;}
    45%{opacity:.3;}
    50%{opacity:.8;}
    55%{opacity:.3;}
    60%{opacity:.8;}
    100%{opacity:0;}
}
</style>
</head>
<body>
<div>
    <span class="a1">CSS3 Animations</span>
    <span class="a2">CSS3 Animations</span>
    <span class="a3">CSS3 Animations</span>
</div>
</body>
</html>
			</textarea>
			<p><input type="button" value="运行" class="g-btn g-btn-sure" /></p>
		</div>
	</section>
</section>
<footer id="ft">
	<aside id="rights" class="g-mod">
		<!-- 插入浏览器及版权信息 -->
	</aside>
</footer>
<script src="../../js/jquery.js"></script>
<script src="../../js/inner.js"></script>
</body>
</html>